#!/bin/bash
#seek all prime number in 2 to 100000
for (( a=2; a<=100000; a++ ))
do 
   i=0
   for (( b=1; b<=$a; b++ ))
   do
      var1=$(expr $a % $b)
      if [ $var1 -eq 0 ]  
      then
        i=$(expr $i + 1 )
      fi
      if [ $i -gt 2 ]
      then 
         continue 2
      fi
   done
   echo $a >> prime.txt
  
done
echo work is over
